package util;

import java.util.Iterator;
import java.util.concurrent.CopyOnWriteArrayList;

import containers.Build;

public class BuildIterator implements Iterator<Build> {
	private CopyOnWriteArrayList<Build> builds;
	private int index = 0;
	
	public BuildIterator(CopyOnWriteArrayList<Build> b){
		builds = b;
	}
	
	public boolean hasNext(){
		return !(builds.size()==index);
	}
	
	public Build next(){
		return builds.get(index++);
	}
	
	public void remove(){
		builds.remove(index-1);
	}
}
